Skip to content

fix(plugin-harness): add no-op process_deferred_updates to test double#391

Merged
ChuckBuilds merged 1 commit into
mainfrom
fix/harness-process-deferred-updates
Jul 11, 2026
Merged

fix(plugin-harness): add no-op process_deferred_updates to test double#391
ChuckBuilds merged 1 commit into
mainfrom
fix/harness-process-deferred-updates

Conversation

@ChuckBuilds

@ChuckBuilds ChuckBuilds commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Summary

The plugin-safety harness's VisualTestDisplayManager (base class of
BoundsCheckingDisplayManager) doesn't implement process_deferred_updates().
Five first-party plugins in ledmatrix-plugins call it unconditionally,
right alongside set_scrolling_state(), before updating scroll position:
news, odds-ticker, ledmatrix-leaderboard, stock-news, and
ledmatrix-stocks. Any of them fails the harness with AttributeError
the instant it's touched, even though the call is completely safe against
the real production display_manager.py (which has always had this
method).

This surfaced concretely in ledmatrix-plugins#177,
which had to add a local hasattr(self.display_manager, "process_deferred_updates")
guard in ledmatrix-stocks/manager.py just to get CI green — a workaround
for this exact gap, not a real plugin bug. The other 4 plugins are still
unguarded and will hit the same failure the next time any of them is
touched.

Fix

Add process_deferred_updates() to VisualTestDisplayManager as a no-op,
mirroring the existing "no-op for testing" pattern already used a few lines
above for set_scrolling_state(). This double has no deferred-update queue
to process, so there's nothing to do — the point is just to stop raising
AttributeError for callers that assume the method exists (as production
code always can).

Test plan

  • Added test_process_deferred_updates_is_noop to test/plugins/test_visual_rendering.py,
    next to the existing test_scrolling_state test, asserting the call
    doesn't raise and doesn't disturb scrolling state.
  • python3 -m py_compile on both touched files.
  • Read through test/plugins/test_harness.py, test_visual_rendering.py,
    and test_plugin_matrix.py to confirm none of them do exhaustive
    method-set introspection that this addition would break.
  • Existing CI (test.ymlpytest test/plugins/test_harness.py test/plugins/test_visual_rendering.py test/plugins/test_plugin_matrix.py)
    will exercise this on the PR.

Follow-up (not in this PR)

Once this merges, the local hasattr guard added in
ledmatrix-plugins#177 becomes unnecessary (though harmless to leave). The
other 4 affected plugins (news, odds-ticker, leaderboard, stock-news) need
no changes at all — they'll simply stop failing the harness next time
they're touched.

Summary by CodeRabbit

  • Bug Fixes

    • Improved compatibility with ticker-style visual plugins by safely handling deferred update calls during scrolling.
    • Prevented test rendering failures when deferred updates are requested.
  • Tests

    • Added coverage confirming deferred update handling is harmless and preserves scrolling state.

The safety harness's VisualTestDisplayManager (base of
BoundsCheckingDisplayManager) doesn't implement process_deferred_updates(),
which 5 first-party ledmatrix-plugins call unconditionally between
set_scrolling_state() and their scroll-position update: news, odds-ticker,
ledmatrix-leaderboard, stock-news, and ledmatrix-stocks. Any of them fails
the harness with AttributeError the moment it's touched (surfaced when
ledmatrix-plugins#177 had to add a local hasattr guard in ledmatrix-stocks
just to pass CI). Add the method as a no-op, mirroring the existing
"no-op for testing" pattern already used for set_scrolling_state, so these
plugins render under the harness without every touching PR needing its own
guard.
@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4c5dfa31-4e8c-4d22-b10c-6da25fdb2974

📥 Commits

Reviewing files that changed from the base of the PR and between 978a03b and 0c7cf09.

📒 Files selected for processing (2)
  • src/plugin_system/testing/visual_display_manager.py
  • test/plugins/test_visual_rendering.py

📝 Walkthrough

Walkthrough

VisualTestDisplayManager now implements a no-op process_deferred_updates() hook, with a test confirming the call does not alter scrolling state.

Changes

Visual display deferred updates

Layer / File(s) Summary
Add and validate deferred-update hook
src/plugin_system/testing/visual_display_manager.py, test/plugins/test_visual_rendering.py
VisualTestDisplayManager provides a no-op process_deferred_updates() method, and its test confirms the method is harmless while scrolling remains enabled.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly states the main change: adding a no-op process_deferred_updates method to the test double.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/harness-process-deferred-updates

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@ChuckBuilds ChuckBuilds merged commit 2ffc57c into main Jul 11, 2026
7 checks passed
@ChuckBuilds ChuckBuilds deleted the fix/harness-process-deferred-updates branch July 11, 2026 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant